
package com.sausageking.shared;

public class OfferUtil {

  public String getRewardStr(Offer offer) {
    switch (offer.getRewardType()) {
      case CUSTOMIZED :
        return offer.getRewardDescription();
      case FLAT_DISCOUNT :
        return "$" + offer.getDiscountValue() + "off";
      case PERCENTAGE_DISCOUNT :
        return offer.getDiscountValue() + "% off";
      default :
        return "";
    }
  }

  public String getDealDescription(Offer offer) {
    switch (offer.getRewardType()) {
      case CUSTOMIZED :
        return offer.getRewardDescription();
      case FLAT_DISCOUNT :
        return "$" + offer.getDiscountValue() + "off";
      case PERCENTAGE_DISCOUNT :
        return offer.getDiscountValue() + "% off";
      default :
        return "";
    }
  }
}
